import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home',
    component: () => import('@/laylout/indexAdd.vue'),
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/indexAdd.vue')
      },
      {
        path: '/friends',
        component: () => import('@/views/friends/indexAdd.vue')
      },
      {
        path: '/cart',
        component: () => import('@/views/cart/indexAdd.vue')
      },
      {
        path: '/search',
        component: () => import('@/views/search/indexAdd.vue')
      }
    ]
  },
  {
    path: '*',
    component: () => import('@/views/404/indexAdd.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router